﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Admin.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<%@ Import Namespace="Chowpoo.Util" %>
<%@ Import Namespace="CourseSystem.Common.Helpers" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    章节练习与作业
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <% var cid = ViewData["ChapterId"].CheckInt(0);
       var sectionId = ViewData["SectionId"].CheckInt(0);
       var type = ViewData["type"].CheckInt(0);
    %>
    <% Html.RenderPartial("AdminTopUc", "章节练习与作业"); %>
    <% using (Html.BeginForm("SectionTest", "AdminExamLib", FormMethod.Get))
       {%>
    <table width="100%" border="0" cellpadding="0" cellspacing="1" class="table03">
        <tr class="box06">
            <td width="10%" height="27" align="center">
                <div align="right">
                    章 :
                </div>
            </td>
            <td width="13%" align="center" class="bg3">
                <div align="left">
                    <%=Html.DropDownList("ChapterId", ChapterHelper.GetChapter(false), new { onchange = "collegeChange();" })%>
                </div>
            </td>
            <td width="11%" align="center">
                <div align="right">
                    节 :</div>
            </td>
            <td align="center" class="bg3">
                <div align="left">
                    <%=Html.DropDownList("SectionId", SectionHelper.GetSection(cid,false))%>
                </div>
                <div align="left">
                </div>
            </td></tr><tr>
            <td align="center" class="bg3">
                <div align="left">
                    <input type="submit" name="set0" value="设置该节练习" />
                </div>
            </td>
            <td align="center" class="bg3">
                <div align="left">
                    <input type="submit" name="set1" value="设置该节作业" />
                </div>
            </td>
            <td align="center" class="bg3">
                <div align="left">
                    <input type="submit" name="set2" value="设置整门课程练习" />
                </div>
            </td>
            <td align="center" class="bg3">
                <div align="left">
                    <input type="submit" name="set3" value="设置整门课程作业" />
                </div>
            </td>
        </tr>
    </table>
    <% } %>
    <table width="100%" height="5" border="0" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF">
        <tr>
            <td height="5" bgcolor="#FFFFFF">
            </td>
        </tr>
    </table>
    <div id="listDiv">
        <% Html.RenderAction("SectionListUc", new { sectionId, type });%>
    </div>
    <div id="editDiv" title="编辑">
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HeaderContent" runat="server">
    <script type="text/javascript">
        var collegeChange = function () {
            selectLoad("SectionId", "Ajax/GetSection/" + $("#ChapterId").val());
        };
        $(function () {
            $("#editDiv").dialog({
                autoOpen: false,
                height: 260,
                width: 350,
                modal: true,
                close: function () {
                    window.location.reload();
                }
            });
        });
        var editClickA = function (id) {
            $("#editDiv").html("loading...");
            $("#editDiv").load(appRoot + 'AdminExamLib/SectionTestEditUc/' + id + '?rd=' + rdTime());
            $("#editDiv").dialog("open");
        };
        var updateScore = function (id) {
            $.get(appRoot + 'AdminExamLib/ExaminationUpdateScore/' + id + "?rd=" + rdTime(), null, function (data) {
                alert(data);
            });
        };
    </script>
</asp:Content>
